from httprunner import HttpRunner, Config, Step, RunRequest, RunTestCase
from api_test.testcases.shop_manage.shop_list_test import TestShopList

class TestGetShopInfo(HttpRunner):

    config = Config("获取详情").base_url("${get_http_host()}").verify(False)
    teststeps = [
        Step(
            RunTestCase("获取id,token")
            .call(TestShopList)
            .export(*("shopId", "token"))
        ),

        Step(
            RunRequest("获取商品详情")
            .post("/shop/simpleShopInfo")
            .with_headers(**{"OKCLOUD-TOKEN": "$token"})
            .with_params(**{"shopId": "f4f2036297064d9fa0a26de41509b24b"})
            .validate()
            .assert_equal("body.code", 200)
            .assert_equal("body.message", "Success")
        )
    ]
